In early data processing systems, users seeking to query a database typically required knowledge of the database structure in order to generate an appropriate query expression. For example, a user might inspect the headings of various columns of data within the database, then enter a query expression that specifies a subset of the columns and search terms to be applied within the specified columns. While such an open-system approach enables flexible and precise query construction, it tends to be impractical in applications where the underlying structure and complexity of the database is necessarily hidden from selected classes of users. Even when the underlying structure of the database may be broadly exposed, users not specifically trained in the database structure and query syntax may find it difficult to construct appropriate query expressions; a circumstance that typically leads to inaccurate query results and an increased number of database queries as users attempt to refine query expressions through trial and error.
Two general query construction techniques have been developed to enable users to construct query expressions without exposing the underlying structure and complexity of the database: form-guided query construction and natural language parsing. In form-guided query construction, a user enters search terms into fields of an on-screen form. Each field is typically labeled to indicate the nature of data to be entered and corresponds to one or more columns of data within the database to be searched. After the user enters the information and requests the search results, the database management system constructs a query expression based on the user-entered information, then executes the query. While the form-guided approach works well for simple searches, it is often impractical to provide an entry field for each searchable column of the database so that the resulting query expressions tend to be limited to a subset of the searchable columns and to specific logical combinations of column search results. Also, to achieve combinations of search terms to be searched within a given column, the user typically must become familiar with the available set of operators and the consequences of including operators with different types of search terms. Similarly, the user may need to become familiar with one or more wildcard operators to cover desired declensions of search terms. Because such complexities tend to be daunting to many users, the form-guided approach is often limited to applications that require only a subset of the database columns to be searched using a relatively simple set of operators. When more advanced queries are required, form-guided systems may direct users to bypass the entry forms and enter queries more directly using the open-system approach described above.
In natural language parsing, the user enters an unstructured search phrase that expresses the desired search results. In contrast to the open-system and form-guided approaches, the user is not required to identify which search terms correspond to which database columns and is not required to adhere to a particular set of operators or query syntax. Instead, the system executes a language parsing program to identify keywords and operators in the search phrase, generate likely declensions of the keywords, identify database columns to which the keywords may apply, and construct a structured query expression that combines the declensions of the keywords in the manner specified by the operators to search the database. A key benefit of query construction through natural language parsing is that users may enter search phrases without knowing the underlying database structure and or the system query language. Unfortunately, query expressions created through natural language parsing may fail to return accurate search results due to imprecise keyword/operator identification, declension generation, and keyword-to-database column matching. Consequently, systems that have natural language query construction interfaces often provide alternative query construction interfaces such as the form-guided and open-system interfaces described above.